# -*- encoding: utf-8 -*-
"""
File Name: subscriber_factory
Description:
Author : 'lirui'
date: 2024/1/25
Contact: marjey_lee@163.com
Change Activity:
2024/1/25:
"""
from typing import Type

from projects.monitoring.alarm_manager.modules.subscribers.base_subscriber import BaseSubscriber
from projects.monitoring.alarm_manager.modules.subscribers.impl.branch_dedicated_line_subscriber import BranchDedicatedLineSubscriber
from projects.monitoring.alarm_manager.modules.subscribers.impl.dedicated_line_subscriber import DedicatedLineSubscriber
from projects.monitoring.alarm_manager.modules.subscribers.impl.internet_zabbix_subsciber import InternetZabbixSubscriber
from projects.monitoring.alarm_manager.modules.subscribers.impl.sipder_subsciber import WebSpiderSubscriber
from projects.monitoring.alarm_manager.modules.subscribers.impl.zabbix_subsciber import ZabbixSubscriber


class SubscriberFactory:
    @staticmethod
    def create(channel) -> Type[BaseSubscriber]:
        """

        Args:
            channel:

        Returns:

        """
        if channel == 'zabbix':
            return ZabbixSubscriber
        if channel == 'dedicated_line_monitor':
            return DedicatedLineSubscriber
        if channel == 'branch_dedicated_line_monitor':
            return BranchDedicatedLineSubscriber
        if channel == 'web_spider':
            return WebSpiderSubscriber
        if channel == 'internet_zabbix':
            return InternetZabbixSubscriber
        raise Exception(f'Not implement {channel}.')
